<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
    	request.setAttribute("group", 5);
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录/注册</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/bootstrap-theme.css">
<link rel="stylesheet" href="assets/css/login-jsp.css">
<link rel="stylesheet" type="text/css" href="js/jquery-ui.css">
<script type="text/javascript" src="js/jQuery-1.9.1.js"></script>
</head>
<body class="linear">
	<header class="navbar navbar-demo" id="top" role="banner">
		<div id="navOne" class="navbar" role="navigation">
				<div class="navbar-header">
					<button type="button" style="margin:10px 0 0 0" class="navbar-toggle" data-toggle="collapse" disabled="disabled" 
						data-target=".navbar-collapse">
						<span class="sr-only">Toggle navigation</span> <span
							class="icon-bar"></span> <span class="icon-bar"></span> <span
							class="icon-bar"></span>
					</button>
					<div class="navbar-brand"> 
						<img src="assets/img/logo_title.png" alt="">
						<h1 class="bjtu-title" style="">登陆文本标注系统</h1>
					</div>
				</div>
		</div>
	</header>
	<div class="container-fluid myrow">
		<div class="row myrow">
		    <div class="col-xs-12 col-sm-12 col-md-3"><!-- col-md-offset-3 -->
		      <div class="login-panel panel panel-default">
		        <div class="panel-heading">登陆</div>
		        <div class="panel-body">
		            <fieldset>
		              <div class="form-group">
		                <input class="form-control" id="useridl" placeholder="用户名" name="checkcode" type="email" autofocus="">
		              </div>
		              <div class="form-group">
		                <input class="form-control" id="passwordl" placeholder="密码" name="password" type="password" value="">
		              </div>
		              <div class="text-center">
			               <a href="javascript:void(0);" class="btn btn-primary" id="login">登陆</a>
			               <a href="javascript:void(0);" class="btn btn-primary" id="register">注册</a>
			               <button class="btn btn-primary"  id="vistor">游客</button>
		              </div>
		              <div class ="text-center">
		              <p1 id="errorLogin" style="color:red; font-size:16px">
		              </div>
		            </fieldset>
		        </div>
		      </div>
		    </div><!-- /.col-->
		    <div class="col-xs-12 col-sm-12 col-md-8  myjumb"><!-- col-md-offset-3 -->
			    <p>微信公众号文本标注系统，旨在方便用户对公众号文本类别进行标注，并帮助工作人员进行标注结果的统计。</p>
				<p>微信公众号文本标注系统，旨在方便用户对公众号文本类别进行标注，并帮助工作人员进行标注结果的统计。</p>
				<p>微信公众号文本标注系统，旨在方便用户对公众号文本类别进行标注，并帮助工作人员进行标注结果的统计。</p>
				<p>微信公众号文本标注系统，旨在方便用户对公众号文本类别进行标注，并帮助工作人员进行标注结果的统计。</p>
		    </div>
		    
	  </div>
  </div>
	<footer>
		<p class="text-center" style="margin:20px 0 20px 0">版权所有 北京交通大学交通数据挖掘实验室</p>
	</footer>

<!-- 	<div style="position:absolute;bottom:0;left:50%;transform:translate(-50%,-50%)" align="center">
		<p class="text-center">版权所有 北京交通大学交通数据挖掘实验室</p >
	</div> -->
	<script type="text/javascript">		
		~function(){
			function loginbtn(){
				var id = eval(document.getElementById('useridl')).value;
				var password = eval(document.getElementById('passwordl')).value;
				if (id.length == 0 || password.length == 0) {
					document.getElementById("errorLogin").innerHTML = "请输入您的信息";
				}else{
					url = "./label/login.do";
					$.ajax({
						url : url,
						type : "POST",
						dataType : 'json',
						data : {
							userid : id,
							password : password
						},
						success : function(data) {
							var obj = JSON.parse(data);//转换后的JSON对象
						    if(obj.code == 0){
						    	window.location = "./label/gettext.do";
							}else if(obj.code == 400){
								document.getElementById("errorLogin").innerHTML = "用户名或密码错误";
							}
						}
					});
				}
			}
			$("#login").click(loginbtn);
			$("#register").click(function(){
				window.location.href = "register.jsp";
			});
			$("#vistor").click(function(){
				window.location = "./label/gettext.do";
			});
			
			$("#useridl").val("");
			$("#passwordl").val("") ;
		}();
	</script>
</body>
</html>